﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Engine testing</title>
    <script src="shims/deepClone.js"></script>
    <script src="shims/ClassicalOop.js"></script>
    <script src="tetris.js"></script>
    <script src="Vector2D.js"></script>
    <script src="TileFactory.js"></script>
    <script src="RandomNumberGenerator.js"></script>
    <script src="FallingZ.js"></script>
    <script src="FallingSquare.js"></script>
    <script src="FallingLine.js"></script>
    <script src="FallingJ.js"></script>
    <script src="FallingL.js"></script>
    <script src="FallingS.js"></script>
    <script src="FallingT.js"></script>
    <script src="Engine.js"></script>
    <script src="Block.js"></script>
    <script src="_FallingObject.js"></script>
</head>
<body>
    <script>
        var Engine = function (renderer, controller, refreshRate) {
            this._gameObjects = [];
            this.renderer = renderer;
            this.controller = controller;
            this.refreshRate = refreshRate;
        };
        Engine.prototype.start = function () {
            var tileFactory = new tetris.TileFactory();
            
            var tile = tileFactory.createObject();

            this._gameObjects.push(tile);

            this.controller.processInput();
            
            var collisionDetector = new tetris.CollisionDetector();

            collisionDetector.check(tile, earth);

            this.renderer.renderObjects(this._gameObjects);

            setTimeout(this.start(), this.refreshRate);
        };
        Engine.prototype.method1 = function () {

        };
        Engine.prototype.method2 = function () {

        };
        Engine.prototype.method3 = function () {

        };
        Engine.prototype.method4 = function () {

        };
        Engine.prototype.method5 = function (x, y) {

        };
        Engine.prototype.method6 = function () {

        };
        Engine.prototype.method7 = function () {

        };
        Engine.prototype.method8 = function () {

        };

        tetris.Engine = Engine;
    </script>
</body>
</html>
